import request from '@/assets/request.js'
/*
请求封装说明
表单格式提交 post请求: .post();  get请求: .get();
对象格式提交 post请求: .JSON_Post();
blob 用于导出 post.JSON格式：.blob_post_json();blob_get_json()
 post表单： .blob_post() ;get表单： .blob_get();

delete 删除
export function delFourPlusOne(param = {}) { // 删除(主键)
  return request.delete('/investment/four-plus-one/delete/'+ param)
}

添加接口加载动画
案例 export function api(param = {}, resParams) { //api
  return request.post(url, param, resParams,)
}
*/
// var url1 = '/api'
// var url2 = '/api'
// var url3 = '/api'
var url1 = ''
var url2 = ''
var url3 = ''

//大屏
export function weather(param = {}, resParams) { //天气
  return request.get('/api/dataScreen/weather', param, resParams, {
    loading: true
  })
}

// 用户管理
export function download_user(param = {}, resParams) { //导入模板下载
  return request.blob_get('/api/system/user/download', param, resParams, { loading: true })
}
export function import_user(param = {}, resParams) { //导入
  return request.arraybuffer_post('/api/system/user/import', param, resParams, { loading: true })
}
export function login(param = {}, resParams) { //登录
  return request.post('/api/system/user/login', param, resParams, {
    loading: true
  })
}
export function codeImage_user(param = {}, resParams) { //验证码
  return request.get('/api/system/user/codeImage', param, resParams, {
    loading: true
  })
}
export function logout_user(param = {}, resParams) { //登出
  return request.post('/api/system/user/logout', param, resParams, {
    loading: true
  })
}
export function updatePassword_user(param = {}, resParams) { //修改密码
  return request.post('/api/system/user/updatePassword', param, resParams, {
    loading: true
  })
}
export function resetPassword_user(param = {}, resParams) { //重置密码
  return request.post('/system/user/resetPassword', param, resParams, {
    loading: true
  })
}
export function insert_user(param = {}, resParams) { //新增
  return request.JSON_Post('/api/system/user/insert', param, resParams, {
    loading: true
  })
}
export function update_user(param = {}, resParams) { //修改
  return request.JSON_Post('/api/system/user/update', param, resParams, {
    loading: true
  })
}
export function delete_user(param = {}, resParams) { //删除
  return request.JSON_Post('/api/system/user/deleteById', param, resParams, {
    loading: true
  })
}
export function page_user(param = {}, resParams) { //分页查询
  return request.get('/api/system/user/page', param, resParams, {
    loading: true
  })
}
export function getUserInfo_user(param = {}, resParams) { //详情
  return request.get('/api/system/user/getUserInfo', param, resParams, {
    loading: true
  })
}

//学校管理

export function importGoods_transitInventory(param = {}, resParams) { //导入商品
  return request.blob_post('/purchase/transitInventory/importExcel', param, resParams, {
    loading: true
  })
}
export function import_template_transitInventory(param = {}, resParams) { //商品导入模板下载
  return request.blob_get('/api/school/download', param, resParams, {
    loading: true
  })
}
export function insert_school(param = {}, resParams) { //新增
  return request.JSON_Post('/api/school/insert', param, resParams, {
    loading: true
  })
}
export function update_school(param = {}, resParams) { //修改
  return request.JSON_Post('/api/school/update', param, resParams, {
    loading: true
  })
}
export function delete_school(param = {}, resParams) { //删除
  return request.JSON_Post('/api/school/deleteById', param, resParams, {
    loading: true
  })
}
export function page_school(param = {}, resParams) { //分页查询
  return request.get('/api/school/findList', param, resParams, {
    loading: true
  })
}
export function findListForDataScreen_school(param = {}, resParams) { //大屏学校
  return request.get('/api/school/findListForDataScreen', param, resParams, {
    loading: true
  })
}
export function getUserInfo_school(param = {}, resParams) { //详情
  return request.get('/api/school/getSimpleUserInfo', param, resParams, {
    loading: true
  })
}
//消息管理

export function insert_messages(param = {}, resParams) { //新增
  return request.JSON_Post('/api/messages/insert', param, resParams, {
    loading: true
  })
}
export function selectSchoolUser_messages(param = {}, resParams) { //获取所有学校里人接收人
  return request.JSON_Post('/api/system/user/selectSchoolUser', param, resParams, {
    loading: true
  })
}
export function update_messages(param = {}, resParams) { //修改
  return request.JSON_Post('/api/messages/update', param, resParams, {
    loading: true
  })
}
export function delete_messages(param = {}, resParams) { //删除
  return request.JSON_Post('/api/messages/deleteById', param, resParams, {
    loading: true
  })
}
export function page_messages(param = {}, resParams) { //分页查询
  return request.get('/api/messages/findList', param, resParams, {
    loading: true
  })
}
export function getUserInfo_messages(param = {}, resParams) { //详情
  return request.get('/api/messages/getSimpleUserInfo', param, resParams, {
    loading: true
  })
}


//大屏


export function treecity_data(param = {}, resParams) { //省市县
  return request.post('/api/city/list/tree', param, resParams, {
    loading: true
  })
}
export function earlyWarning_data(param = {}, resParams) { //查询大屏总信息
  return request.post('/api/earlyWarning/list', param, resParams, {
    loading: true
  })
}
export function findNodeCount_data(param = {}, resParams) { //短信数量
  return request.get('/api/node/findNodeCount', param, resParams, {
    loading: true
  })
}
export function findList_data(param = {}, resParams) { //短信列表
  return request.get('/api/node/findList', param, resParams, {
    loading: true
  })
}
export function earlyWarningListByYhdId_data(param = {}, resParams) { //查看易发点历史预警
  return request.post('/api/warning/earlyWarningListByYhdId', param, resParams, {
    loading: true
  })
  // yhdId date
}
export function findDetailList_data(param = {}, resParams) { //查询短信明细列表
  return request.get('/api/node/findDetailList', param, resParams, {
    loading: true
  })
}
export function listArea_data_test(param = {}, resParams) { //左下角
  return request.post('/api/warning/areaList', param, resParams, {
    loading: true
  })
}
export function earlyWarning_data_test(param = {}, resParams) { //查询大屏总信息测试
  return request.post('/api/warning/findAllList', param, resParams, {
    loading: true
  })
}
export function findList_data_test(param = {}, resParams) { //查询预警列表测试
  return request.post('/api/warning/findList', param, resParams, {
    loading: true
  })
}
export function listArea_data(param = {}, resParams) { //查询预警地区
  return request.post('/api/earlyWarning/listArea', param, resParams, {
    loading: true
  })
}
export function findDiZhiYear_data(param = {}, resParams) { //易发点列表
  return request.post('/api/earlyWarning/findDiZhiYear', param, resParams, {
    loading: true
  })
}

export function find_data(param = {}, resParams) { //查询范围内的学校
  return request.post('/api/earlyWarning/find', param, resParams, {
    loading: true
  })
}
export function findDiZhi_data(param = {}, resParams) { //获取柳州市所有行政区当日地质灾害预警预报等级接口
  return request.post('/api/earlyWarning/findDiZhi', param, resParams, {
    loading: true
  })
}
